package com.aizuda.boot.modules.business.counterparty.mapper;

import com.aizuda.boot.modules.business.counterparty.entity.CounterpartyInfoEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jakarta.validation.constraints.NotBlank;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 交易方信息表 Mapper 接口
 */
@Repository
public interface CounterpartyInfoMapper extends BaseMapper<CounterpartyInfoEntity> {
    
    /**
     * 根据ID列表批量查询交易方信息
     */
    List<CounterpartyInfoEntity> selectByIds(@Param("ids") List<Integer> ids);

    /**
     * 检查交易方名称、证件ID、系统租户是否唯一
     */
    int checkCounterparty(@Param("counterpartyId") Integer counterpartyId,
                          @Param("counterpartyName") String counterpartyName,
                          @Param("certificateId") String certificateId,
                          @Param("sysTenantKey") String sysTenantKey);
}